package com.wwl.cms.utils.designModeTest.composite;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/7 19:06
 * @description:
 */
public class Client {
    public static void main(String[] args) {
        //从小到达创建对象 学校
        OrganizationComponent university = new University("清华大学","中国顶级大学");
        //创建学院
        OrganizationComponent componentCollege = new College("计算机学院","计算机学院");
        OrganizationComponent infoEngineercollege = new College("信息工程学院","信息工程学院");
        //创建各学院下面的系(专业)
        componentCollege.add(new Department("软件工程","软件工程不错"));
        componentCollege.add(new Department("网络工程","网络工程不错"));
        componentCollege.add(new Department("计算机科学与技术","计算机科学与技术是老牌专业。"));

        infoEngineercollege.add(new Department("通信工程","通信工程不好学"));
        infoEngineercollege.add(new Department("信息工程","信息工程好学"));

        university.add(componentCollege);
        university.add(infoEngineercollege);
        university.print();
    }
}
